
#ifndef _APPLICATION_H_
#define _APPLICATION_H_

#include "defines.hpp"
#include "ApplicationApi.hpp"
#include "../OLCore/AbstractApplication.hpp"

#include <QCoreApplication>


namespace NSApplication {

	class APPLICATIONAPI Application : 
		public NSCore::AbstractApplication 
	{
		Q_OBJECT 
	public:
		Application(int argc, char* argv[]);
		~Application();

	public:
		template<typename T>
		T* getManager(QString name) {
			if (m_objects.contains(name)) {
				return dynamic_cast<T*>(m_objects.value(name));
			}
			return nullptr;
		}
		Q_INVOKABLE  NSCore::AbstractObject* getManager(QString name) {
			if (m_objects.contains(name)) {
				return m_objects.value(name);
			}
			return nullptr;
		}
		virtual void registerManager(QString name, NSCore::AbstractObject* object) override;
		Q_INVOKABLE virtual inline QString className() override { return "Application"; };

	};
}

#endif


